<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\cms\model\wx;

use app\cms\model\Users;
use plugin\saiadmin\basic\BaseModel;

/**
 * 微信用户模型
 */
class WxloginMember extends BaseModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'id';

    /**
     * 数据库表名称
     * @var string
     */
    protected $table = 'eb_wxlogin_member';


    /**
     * 微信昵称 搜索
     */
    public function searchNicknameAttr($query, $value)
    {
        $query->where('nickname', 'like', '%' . $value . '%');
    }


    public function users()
    {
        return $this->hasOne(Users::class, 'id', 'user_id');
    }
}
